package ysq.xyg.sale.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 销售模块-销售产品实体类
 *
 * @author shengQiang yu
 * @date 2019-9-9 14:17:04
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_sale_product")
public class SaleProduct implements Serializable{

	/**
     * id
     */ 
	@Id
	private String id;
	
	/**
     * 名称
     */ 
	@Column(name = "name")
	private String name;

	/**
	 * 试用期价格/元
	 */
	@Column(name = "price")
	private Double price;

	/**
	 * 试用期天数
	 */
	@Column(name = "use_day")
	private Integer useDay;

	/**
	 * 一年价格/元
	 */
	@Column(name = "one_year_price")
	private Double oneYearPrice;

	/**
	 * 二年价格/元
	 */
	@Column(name = "two_year_price")
	private Double twoYearPrice;

	/**
	 * 三年价格/元
	 */
	@Column(name = "three_year_price")
	private Double threeYearPrice;

	/**
	 *项目地址
	 */
	@Column(name = "home_url")
	private String homeUrl;

	/**
	 * 人员创建地址
	 */
	@Column(name = "user_url")
	private String userUrl;

	/**
     * 所属分类
     */ 
	@Column(name = "col_id")
	private String colId;
	
	/**
     * 缩略图
     */ 
	@Column(name = "thum_image")
	private String thumImage;
	
	/**
     * 内容
     */ 
	@Column(name = "content")
	private String content;
	/**
	 * 版本号
	 */
	@Column(name = "version_num")
	private String versionNum;
	/**
	 * 版本记录
	 */
	@Column(name = "version_record")
	private String versionRecord;
	/**
     * 排序号，数据越大越往前
     */ 
	@Column(name = "sort")
	private String sort;
	
	/**
     * 是否展示:1、是，2、否
     */ 
	@Column(name = "show_type")
	private String showType;
	
	/**
     * 删除标识：1、正常，2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	

	public SaleProduct(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}